@import './base.less';
@box-background-color: rgba(28, 29, 34, 0.4);

.h5wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding-top: constant(safe-area-inset-top); /* 兼容 iOS < 11.2 */
  padding-top: env(safe-area-inset-top); /* 兼容 iOS >= 11.2 */
  overflow: hidden;
  background-color: #000;
}

@media (prefers-color-scheme: light) {
  .h5wrap {
    background-color: #fff;
  }
}

.h5main {
  position: relative;
  flex: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  height: 50%; // 得设置一个高度，不能有断层，否则后续子孙元素无法使用 scrool
  padding-bottom: constant(safe-area-inset-bottom); /* 兼容 iOS < 11.2 */
  padding-bottom: env(safe-area-inset-bottom); /* 兼容 iOS >= 11.2 */
  background-color: #fff;
  color: @text-color;
  font-size: 0.28rem;
  line-height: 1.5;

  &.not-safe-area {
    padding-bottom: 0.2rem;
  }
}

.h5player__exit {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  top: 0.18rem;
  left: 0.32rem;
  width: 0.48rem;
  height: 0.48rem;
  font-size: 0.4rem;
  text-align: center;
  border-radius: 50%;
  background-color: @box-background-color;
  z-index: 100;
  color: rgba(255, 255, 255, 0.8);
}

.h5tabs {
  display: flex;
  justify-content: space-around;
  width: 100%;
  height: @tabs-height;
  line-height: @tabs-height;
}

.h5tabs-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.28rem;
  color: @text-color;
  flex: 1 1 30%;

  &:not(:last-child) {
    border-right: 0.02rem solid #e6e7ec;
  }

  .h5tabs-item-button {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 0.84rem;
    height: 0.64rem;
    border-right: 0.02rem solid #e6e7ec;
    color: #4d5365;
    font-size: 0.36rem;
  }

  .h5tabs-item-text-wrapper {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    .h5tabs-item-text {
      position: relative;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 0.8rem;
      height: 100%;
      border-bottom: 0.04rem solid transparent;
      white-space: nowrap;
    }
  }
  &.h5tabs-item-active {
    .h5tabs-item-text-wrapper .h5tabs-item-text {
      color: @text-color-darken;
      border-bottom-color: @primary-color;
    }
  }
}

.h5tabs-item__badge {
  position: absolute;
  top: 0.2rem;
  right: 0;
  min-width: 0.36rem;
  height: 0.36rem;
  line-height: 0.36rem;
  padding: 0 0.06rem;
  background-color: #f53f3f;
  color: #fff;
  font-size: 0.24rem;
  text-align: center;
  border-radius: 0.18rem;
  transform: translateX(100%);
}

.h5content__chat,
.h5content__intro {
  flex: auto;
  position: relative;
  width: 100%;
  padding: 0.24rem 0.32rem;
  background-color: #f4f4f6;
  overflow: auto;
}

.h5content__chat {
  height: calc(100% - (@tabs-height + @controls-height));
}

.h5content__intro {
  height: calc(100% - (@tabs-height));
}

.h5content__player {
  flex-grow: 1;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
}

.h5announcement {
  flex-shrink: 0;
  flex-grow: 0;
}

.h5controls {
  flex-shrink: 0;
  flex-grow: 0;
  width: 100%;
  height: @controls-height;
  padding: 0.08rem 0.32rem;
}
